{{define "content"}}
<div class="page-title-box">
    <div class="row align-items-center">
        <div class="col-auto">
            <h2 class="page-title">
                {{.Subtitle}}-{{.Name}}
            </h2>
        </div>
    </div>
</div>
<div class="row">
    <div class="col-12">
        <div class="card">
            <div class="card-body border-bottom py-3">
                <div class="d-flex">
                    <div class="text-muted">
                        查看
                        <div class="mx-2 d-inline-block">
                            <input id="lines" type="text" class="form-control" value="{{.Lines}}" size="3">
                        </div>
                        行
                        <input id="id" type="hidden" value="{{.ID}}">
                        <a id="search" href="javascript:;" class="btn btn-primary ml-3">查询</a>
                        <a href="{{.BackUrl}}" class="btn btn-primary ml-3">返回</a>
                    </div>
                </div>
            </div>
            <div class="list list-row list-hoverable">
                {{- range .Content}}
                <div class="list-item" style="border-top:0px">
                    <div>
                        {{.}}
                    </div>
                </div>
                {{- end}}
            </div>
        </div>
    </div>
</div>
{{end}}
{{define "script"}}
<script type="text/javascript">
    $(document).ready(function () {
        $("#search").on("click", function (event) {
            var id = $("#id").val();
            var lines = $("#lines").val();
            var _lines = parseInt(lines);
            var path = "{{.Path}}";
            if (_lines != NaN) {
                window.location.href = path + "?id=" + id + "&lines=" + lines;
            } else {
                alert("输入行数不正确！")
            }
        });
    });
</script>
{{end}}